home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mem / Icon / Icon.help next >
Encoding:
Text File  |  1993-08-26  |  29.0 KB  |  1,007 lines  |  [TEXT/MPS ]

  1. Icon Programming Language Version 8.10 Help Summaries
  2.  
  3.     Help summaries are available for each of the Icon executable
  4.     programs (icont, iconx), and for many aspects of the Icon
  5.     language itself.    
  6.  
  7.     To see the help summaries, enter one of the following commands:
  8.     
  9.     ihelp icont                 # Icon translator & linker
  10.     ihelp iconx                 # Icon interpreter
  11.  
  12.     ihelp expressions            # summary of expressions & precedence
  13.     ihelp functions             # summary of functions
  14.     ihelp operations            # summary of operations
  15.     ihelp keywords                # list of keywords
  16.     ihelp datatypes             # list of Icon datatypes
  17.     ihelp reserved                # list of reserved words
  18.     ihelp escapes                # list of string escape sequences
  19.     ihelp abbreviations         # abbreviations used in help files
  20.     ihelp <function name>        # information on specific function
  21.     ihelp about                 # bibliography and credits for help file
  22.  
  23. -
  24. abs (N) : N                                # compute absolute value
  25.  
  26. Produces the absolute value of N.
  27. -
  28. acos (r1) : r2                            # compute arc cosine
  29.  
  30. Produces the arc cosine of r1 in the range of 0 to pi for r1 in the
  31. range of -1 to 1.
  32. -
  33. any (c,s,i1,i2) : i3                     # locate initial character
  34.  
  35. Succeeds and produces i1 + 1 if s[i1] is in c and i2 > i1, but fails
  36. otherwise.
  37.  
  38. Defaults:
  39. s        &subject
  40. i1        &pos if s defaulted, otherwise 1
  41. i2        0
  42. -
  43. args (p) : i                             # get number of procedure arguments
  44.  
  45. Produces the number of arguments for procedure p.  For built-in
  46. procedures with a variable number of arguments, the value produced is
  47.  -1.  For declared procedures with a variable number of arguments, the
  48. value returned is the negative of the number of formal prameters.
  49. -
  50. bal (c1,c2,c3,s,i1,i2) : i3,i4,...,in    # locate balanced characters
  51.  
  52. Generates the sequence of integer positions in s preceding a character
  53. of c1 in s[i1:i2] that is balanced with respect to the characters of c2
  54. and c3, but fails if there is no such position.
  55.  
  56. Defaults:
  57. c1        &cset
  58. c2        '('
  59. c3        ')'
  60. s        &subject
  61. i1        &pos if s defaulted, otherwise 1
  62. i2        0
  63. -
  64. callout (x,x1,x2,...,xn) : xm            # call external function
  65.  
  66. Calls the external function specified by x with arguments x1, x2, ...,
  67. xn.  The mechanism for locating the function specified by x is system
  68. dependent.
  69. -
  70. center (s1,i,s2) : s3                    # position string at center
  71.  
  72. Produces a string of size i in which s1 is centered, with s2 used for
  73. padding at left and right as necessary.
  74.  
  75. Defaults:
  76. i        1
  77. s2        " " (blank)
  78. -
  79. char (i) : s                             # produce character
  80.  
  81. Produces a string of length 1 consisting of the character whose
  82. internal representation is i.
  83. -
  84. chdir (s) : n                            # change directory
  85.  
  86. Changes the directory to s but fails if there is no such directory
  87. or if the change cannot be made.
  88. -
  89. close (f) : f                            # close file
  90.  
  91. Produces f after closing it unless f was opened with the pipe ("p")
  92. option, in which case the integer exit status of the command is
  93. returned.
  94. -
  95. collect (i1,i2) : n                        # perform garbage collection
  96.  
  97. Causes a garbage collectionin region i1, requesting i2 bytes of space
  98. in that region.  It fails if the requested space is not available.    The
  99. regions are identified as follows:
  100.  
  101.         1        Static region
  102.         2        String region
  103.         3        Block region
  104.  
  105. If i1 is 0, a collection is done, but no region is identified and i2
  106. has no effect.    The value of i2 is ignored for the static region.
  107.  
  108. Defaults:
  109. i1        0
  110. i2        0
  111. -
  112. copy (x1) : x2                            # copy value
  113.  
  114. Produces a copy of x1 if x1 is a structure; otherwise it produces x1.
  115. -
  116. cos (r1) : r2                            # compute cosine
  117.  
  118. Produces the cosine of r1 in radians.
  119. -
  120. cset (x)                                 # convert to cset
  121.  
  122. Produces a cset resulting from converting x, but fails if the
  123. conversion is not possible.
  124. -
  125. delay (i) : n                            # delay execution
  126.  
  127. Delays execution i milliseconds.
  128. -
  129. delete (X,x) : X                         # delete element
  130.  
  131. If X is a set, deletes x from X.  If X is a table, deletes the element
  132. for key x from X.  Produces X.
  133. -
  134. detab (s1,i1,i2,...,in) : s2             # remove tabs
  135.  
  136. Produces a string based on s1 in which each tab character is replaced
  137. by one or more blanks.    Tab stops are at i1, i2, ..., in, with
  138. additional stops obtained by repeating the last interval.
  139.  
  140. Default:
  141. i1        9
  142. -
  143. display (i,f) : n                        # display variables
  144.  
  145. Writes the image of the current co-expression and the values of the
  146. local variables in the current procedure call.    If i > 0, the local
  147. variables in the i preceding procedure calls are displayed as well.
  148. After all local variables are displayed, the values of global variables
  149. are displayed.    Output is written to f.
  150.  
  151. Defaults:
  152. i        &level
  153. f        &errout
  154. -
  155. dtor (r1) : r2                            # convert degrees to radians
  156.  
  157. Produces the radian equivalent of r1 given in degrees.
  158. -
  159. entab (s1,i1,i2,...,in) : s2             # insert tabs
  160.  
  161. Produces a string based on s1 in which runs of blanks are replaced by
  162. tabs.  Tab stops are at i1, i2, ..., in, with additional stops obtained
  163. by repeating the last interval.
  164.  
  165. Default:
  166. i1        9
  167. -
  168. errorclear () : n                        # clear error indication
  169.  
  170. Clears the indications of the last error.
  171. -
  172. exit (i)                                 # exit program
  173.  
  174. Terminates the program with exit status i.
  175.  
  176. Default:
  177. i        normal exit (system dependent)
  178. -
  179. exp (r1) : r2                            # compute exponential
  180.  
  181. Produces e raised to the power r1.
  182. -
  183. find (s1,s2,i1,i2) : i3,i4,...,in        # find string
  184.  
  185. Generates the sequence of integer positions in s2 at which s1 occurs as
  186. a substring in s2[i1:i2], but fails if there is no such position.
  187.  
  188. Defaults:
  189. s2        &subject
  190. i1        &pos if s2 defaulted, otherwise 1
  191. i2        0
  192. -
  193. flush (f) : n                            # flush I/O buffer
  194.  
  195. Flushes the input/output buffers for f.
  196. -
  197. function () : s1,s2,...,sn                # generate function names
  198.  
  199. Generates the names of the Icon (built-in) functions.
  200. -
  201. get (L) : x                                # get value from list
  202.  
  203. Produces the leftmost element of L and removes it from L, but fails if
  204. L is empty; synonym for pop(L).
  205. -
  206. getenv (s1) : s2                         # get value of environment variable
  207.  
  208. Produces the value of environment variable s1, but fails if the
  209. variable is not set or environment variables are not supported.
  210. -
  211. iand (i1,i2) : i3                        # compute bit-wise "and"
  212.  
  213. Produces the bitwise "and" of i1 and i2.
  214. -
  215. icom (i1) : i2                            # compute bit-wise complement
  216.  
  217. Produces the bitwise complement (1's complement) of i1.
  218. -
  219. image (x) : s                            # produce string image
  220.  
  221. Produces a string image of x.
  222. -
  223. insert (X,x1,x2) : X                     # insert element
  224.  
  225. If X is a table, inserts the key x1 with value x2 into X.  If X is a
  226. set, inserts x1 into X.  Produces X.
  227.  
  228. Default:
  229. x2        &null
  230. -
  231. integer (x) : i                            # convert to integer
  232.  
  233. Produces the integer resulting from converting x, but fails if the
  234. conversion is not possible.
  235. -
  236. ior (i1,i2) : i3                         # compute bit-wise inclusive "or"
  237.  
  238. Produces the bitwise inclusive "or" of i1 and i2
  239. -
  240. ishift (i1,i2) : i3                        # shift bits
  241.  
  242. Produces the result of shifting the bits in i1 by i2 positions.
  243. Positive values of i2 shift to the left, negative to the right.
  244. Vacated bit positions are zero-filled.
  245. -
  246. ixor (i1,i2) : i3                        # compute bit-wise exclusive "or"
  247.  
  248. Produces the bitwise exclusive "or" of i1 and i2.
  249. -
  250. key (T) : x1,x2,...,xn                    # generate keys from table
  251.  
  252. Generates the keys in table T.
  253. -
  254. left (s1,i,s2) : s3                        # position string at left
  255.  
  256. Produces a string of size i in which s1 is positioned at the left, with
  257. s2 used for padding on the right as necessary.
  258.  
  259. Defaults:
  260. i        1
  261. s2        " " (blank)
  262. -
  263. list (i,x) : L                            # create list
  264.  
  265. Produces a list of size i in which each value is x.
  266.  
  267. Defaults:
  268. i        0
  269. x        &null
  270. -
  271. log (r1,r2) : r3                         # compute logarithm
  272.  
  273. Produces the logarithm of r1 to the base r2.
  274.  
  275. Default:
  276. r2        e
  277. -
  278. many (c,s,i1,i2) : i3                    # locate many characters
  279.  
  280. Succeeds and produces the position in s after the longest initial sequence
  281. of characters in c in s[i1:i2].  It fails if s[i1] is not in c.
  282.  
  283. Defaults:
  284. s        &subject
  285. i1        &pos if s defaulted, otherwise 1
  286. i2        0
  287. -
  288. map (s1,s2,s3) : s4                        # map characters
  289.  
  290. Produces a string of size *s1 obtained by mapping characters of s1 that
  291. occur in s2 into corresponding characters in s3.
  292.  
  293. Defaults:
  294. s2        string(&ucase)
  295. s3        string(&lcase)
  296. -
  297. match (s1,s2,i1,i2) : i3                 # match initial string
  298.  
  299. Produces i1 + *s1 if s1 == s2[i1+:*s1], but fails otherwise.
  300.  
  301. Defaults:
  302. s2        &subject
  303. i1        &pos if s2 defaulted, otherwise 1
  304. i2        0
  305. -
  306. member (X,x) : x                         # test for membership
  307.  
  308. If X is a set, succeeds if x is a member of X, but fails otherwise.  If
  309. X is a table, succeeds if x is a key of an element in X, but fails
  310. otherwise.    Produces x if it succeeds.
  311. -
  312. move (i) : s                             # move scanning position
  313.  
  314. Produces &subject[&pos:&pos + i] and assigns i + &pos to &pos, but
  315. fails if i is out of range; reverses assignment to &pos if resumed.
  316. -
  317. name (x) : s                             # produce name
  318.  
  319. Produces the name of the variable x.  If x is an identifier or a
  320. keyword that is a variable, the name of the identifier or keyword is
  321. produced.  If x is a record field reference, the record name and field
  322. name are produced with a separating period.  If x is a string, the name
  323. of the string and the subscript range are shown.  If x is a subscripted
  324. list or table, the type name followed by the subscripting expression is
  325. produced.
  326. -
  327. numeric (x) : N                            # convert to numeric
  328.  
  329. Produces an integer or real number resulting from converting x, but
  330. fails if the conversion is not possible.
  331. -
  332. open (s1,s2) : f                         # open file
  333.  
  334. Produces a file resulting from opening s1 according to options in s2,
  335. but fails if the file cannot be opened.  The options are:
  336.  
  337.         "r"     open for reading
  338.         "w"     open for writing
  339.         "a"     open for writing in append mode
  340.         "b"     open for reading and writing
  341.         "c"     create
  342.         "t"     translate line termination sequences to linefeeds
  343.         "u"     do not translate line termination sequences to linefeeds
  344.         "p"     pipe to/from a command -- UNIX
  345.  
  346. The default mode is to translate line termination sequences to
  347. linefeeds on input and conversely on output.  The untranslated mode
  348. should be used when reading and writing binary files.
  349.  
  350. Default:
  351. s2        "rt"
  352. -
  353. ord (s) : i                                # produce ordinal
  354.  
  355. Produces an integer (ordinal) between 0 and 255 that is the internal
  356. representation of the single character in s.
  357. -
  358. pop (L) : x                                # pop from list
  359.  
  360. Produces the leftmost element of L and removes it from L, but fails if
  361. L is empty; synonym for get(L).
  362. -
  363. pos (i1) : i2                            # test scanning position
  364.  
  365. Produces &pos if &pos = i1, but fails otherwise.
  366. -
  367. proc (x,i) : p                            # convert to procedure
  368.  
  369. Produces a procedure corresponding to the value of x, but fails if x
  370. does not correspond to a procedure.  If x is the string name of an
  371. operator, i specifies the number of arguments: 1 for unary (prefix), 2
  372. for binary (infix), and 3 for ternary.
  373.  
  374. Default:
  375. i        1
  376. -
  377. pull (L) : x                             # pull from list
  378.  
  379. Produces the rightmost element of L and removes it from L, but fails if
  380. L is empty.
  381. -
  382. push (L,x) : L                            # push onto list
  383.  
  384. Adds x to the left end of L and produces L.
  385. -
  386. put (L,x) : L                            # put onto list
  387.  
  388. Adds x to the right end of L and produces L.
  389. -
  390. read (f) : s                             # read line
  391.  
  392. Produces the next line from f, but fails on end of file.
  393.  
  394. Default:
  395. f        &input
  396. -
  397. reads (f,i) : s                            # read string
  398.  
  399. Produces a string consisting of the next i characters from f, or the
  400. remaining characters of f if fewer remain, but fails on an end of
  401. file.  In reads(), unlike read(), line termination sequences have no
  402. special significance.  reads() should be used for reading binary data.
  403.  
  404. Defaults:
  405. f        &input
  406. i        1
  407. -
  408. real (x) : r                             # convert to real
  409.  
  410. Produces a real number resulting from type conversion of x, but fails
  411. if the conversion is not possible.
  412. -
  413. remove (s) : n                            # remove file
  414.  
  415. Removes (deletes) the file named s, but fails if s cannot be removed.
  416. -
  417. rename (s1,s2) : n                        # rename file
  418.  
  419. Renames the file named s1 to be s2, but fails if the renaming cannot be
  420. done.
  421. -
  422. repl (s1,i) : s2                         # replicate string
  423.  
  424. Produces a string consisting of i concatenations of s1.
  425. -
  426. reverse (s1) : s2                        # reverse string
  427.  
  428. Produces a string consisting of the reversal of s.
  429. -
  430. right (s1,i,s2) : s3                     # position string at right
  431.  
  432. Produces a string of size i in which s1 is positioned at the right, with
  433. s2 used for padding on the left as necessary.
  434.  
  435. Defaults:
  436. i        1
  437. s2        " " (blank)
  438. -
  439. rtod (r1) : r2                            # convert radians to degrees
  440.  
  441. Produces the degree equivalent of r1 given in radians.
  442. -
  443. runerr (i,x)                             # terminate with run-time error
  444.  
  445. Terminates program execution with error i and offending value x.
  446.  
  447. Default:
  448. x        no offending value
  449. -
  450. save (s) : i                             # save executable image
  451.  
  452. Saves an executable image of the current running program in the file
  453. named s and produces the size of the file, but fails if the file cannot
  454. be created.
  455. -
  456. seek (f,i) : f                            # seek to position in file
  457.  
  458. Seeks to position i in f, but fails if the seek cannot be performed.
  459. The first byte in the file is at position 1.  seek(f,0) seeks to the
  460. end of file f.
  461. -
  462. seq (i1,i2) : i3,i4,...                    # generate sequence of integers
  463.  
  464. Generates an endless sequence of integers starting at i1 with
  465. increments of i2.
  466.  
  467. Defaults:
  468. i1        1
  469. i2        1
  470. -
  471. set (L) : S                                # create set
  472.  
  473. Produces a set whose members are the distinct values in the list L.
  474.  
  475. Default:
  476. L        []
  477. -
  478. sin (r1) : r2                            # compute sine
  479.  
  480. Produces the sine of r1 given in radians.
  481. -
  482. sort (X,i) : L                            # sort structure
  483.  
  484. Produces a list containing values from X.  If X is a list or a set,
  485. sort(X,i) produces the values of X in sorted order.  If X is a table,
  486. sort(X,i)produces a list obtained by sorting the elements of X,
  487. depending on the value of i.  For Produces a list according to i:
  488.  
  489. i = (1 | 2)     Produces a list of two-element lists of key/value pairs
  490.                 from X; ordered by keys for i = 1, by values for i =
  491.                 2.
  492. i = (3 | 4)     Produces a list of size 2 * *X with each consecutive
  493.                 pair of elements consisting of a key and a value from
  494.                 X; ordered by keys for i = 3, by values for i = 4.
  495.  
  496. Default:
  497. i        1
  498. -
  499. sortf (X,i) : L                            # sort list or set by field
  500.  
  501. Produces a sorted list of the values in X.    Sorting is primarily by
  502. type and in most respects is the same as with sort(X,i).  However,
  503. among lists and among records, two structures are ordered by comparing
  504. their ith fields.  i can be negative but not zero.    Two structures
  505. having the equal ith fields are ordered as they would be in regular
  506. sorting, but structures lacking an ith field appear before structures
  507. having them.
  508.  
  509. Default:
  510. i        1
  511. -
  512. sqrt (r1) : r2                            # compute square root
  513.  
  514. Produces the square root of r1.
  515. -
  516. stop (x1,x2,...,xn)                        # stop execution
  517.  
  518. Terminates program execution with an error status after writing strings
  519. x1,x2,...,xn.  If xi is a file, subsequent output is to xi.  Initial
  520. output is to standard error output.
  521.  
  522. Default:
  523. xi        "" (empty string)
  524. -
  525. string (x) : s                            # convert to string
  526.  
  527. Produces a string resulting from converting x, but fails if the
  528. conversion is not possible.
  529. -
  530. system (s) : i                            # call system function
  531.  
  532. Calls the C library function "system" to execute s and produces the
  533. resulting integer exit status.
  534. -
  535. tab (i) : s                                # set scanning position
  536.  
  537. Produces &subject[&pos:i] and assigns i to &pos, but fails if i is out
  538. of range.  It reverses assignment to &pos if resumed.
  539. -
  540. table (x) : T                            # create table
  541.  
  542. Produces a table with a default value x.
  543.  
  544. Default:
  545. x        &null
  546. -
  547. tan (r1) : r2                            # compute tangent
  548.  
  549. Produces the tangent of r1 given in radians.
  550. -
  551. trim (s1,c) : s2                         # trim string
  552.  
  553. Produces a string consisting of the characters of s1 up to the trailing
  554. characters contained in c.
  555.  
  556. Default:
  557. c        ' ' (blank)
  558. -
  559. type (x) : s                             # produce type name
  560.  
  561. Produces a string corresponding to the type of x.
  562. -
  563. upto (c,s,i1,i2) : i3,i4,...,in            # locate characters
  564.  
  565. Generates the sequence of integer positions in s preceding a character
  566. of c in s[i1:i2].  It fails if there is no such position.
  567.  
  568. Defaults:
  569. s        &subject
  570. i1        &pos if s defaulted, otherwise 1
  571. i2        0
  572. -
  573. variable (s) : x                         # produce variable
  574.  
  575. Produces the variable for the identifier or keyword named s, but fails
  576. if there is no such variable.  Local identifiers override global
  577. identifiers.
  578. -
  579. where (f) : i                            # produce position in file
  580.  
  581. Produces the current byte position in f.  The first byte in the file is
  582. at position 1.
  583. -
  584. write (x1,x2,...,xn) : xn                # write line
  585.  
  586. Writes strings x1,x2,...,xn with a line termination sequence added at
  587. the end.  If xi is a file, subsequent output is to xi.    Initial output
  588. is to standard output.
  589.  
  590. Default:
  591. xi        "" (empty string)
  592. -
  593. writes (x1,x2,...,xn)                    # write string
  594.  
  595. Writes strings x1,x2,...,xn without a line termination sequence added
  596. at the end.  If xi is a file, subsequent output is to xi.  Initial
  597. output is to standard output.
  598.  
  599. Default:
  600. xi        "" (empty string)
  601. -
  602. icont -- Icon translator and linker
  603.  
  604. icont [option...] file...
  605.     -c                        # translate only (no link)
  606.     -o file                 # name icode file "file"
  607.     -s                        # suppress progress messages
  608.     -t                        # give &trace initial value of -1
  609.     -u                        # issue warnings for undeclared identifiers
  610.     -E                        # preprocess only -- write to standard output
  611.  
  612. See also:
  613.     ihelp iconx
  614. -
  615. iconx -- Icon interpreter
  616.  
  617. The Icon interpreter is normally invoked automatically when the name of
  618. an Icon program is entered as a command, but it can be invoked
  619. explicitly, too.
  620.  
  621. iconx icode_file_name [arguments for Icon program.]
  622.  
  623.  
  624.  
  625.     Shell environment variables recognized by iconx
  626.     ===============================================
  627.     Name        Default     Description
  628.     --------    -------     -----------------------
  629.     TRACE        0            Initial value for &trace.
  630.     NOERRBUF    undefined    If set, &errout is not buffered.
  631.     STRSIZE     65000        Initial size (bytes) of string region
  632.                             (strings).
  633.     BLOCKSIZE    65000        Initial size (bytes) of block region
  634.                             (most objects).
  635.     COEXPSIZE    2000        Size (long words) of co-expression blocks.
  636.     MSTKSIZE    10000        Size (long words) of main interpreter stack.
  637.     STATSIZE    20480        Initial size (bytes) of static region
  638.                             (co-expression blocks).
  639.     STATINCR    1/4 of        Increment used to expand static region.
  640.                 STATSIZE
  641.  
  642.  
  643. See also:
  644.     ihelp icont
  645. -
  646. Expressions shown in order of decreasing precedence.  Items in groups
  647. (as separated by empty lines) have equal precedence.
  648.  
  649. High Precedence Expressions
  650.  
  651.     (expr)                        # grouping
  652.     {expr1;expr2;...}            # compound
  653.     x(expr1,expr2,...)            # invocation
  654.     x{expr1,expr2,...}            # "
  655.     [expr1,expr2,...]            # list
  656.     expr.F                        # field reference
  657.     expr1[expr2]                # subscript
  658.     expr1[expr2:expr3]            # section
  659.     expr1[expr2+:expr3]         # "
  660.     expr1[expr2-:expr3]         # "
  661.  
  662. Prefix Expressions
  663.  
  664.     not expr                    # success/failure reversal
  665.     | expr                        # repeated alternation
  666.     ! expr                        # element generation
  667.     * expr                        # size
  668.     + expr                        # numeric value
  669.     - expr                        # negative
  670.     . expr                        # value (dereference)
  671.     / expr                        # null
  672.     \ expr                        # non-null
  673.     = expr                        # match and tab
  674.     ? expr                        # random value
  675.     ~ expr                        # cset complement
  676.     @ expr                        # activation
  677.     ^ expr                        # refresh
  678.  
  679. Infix Expressions
  680.  
  681.     expr1 \ expr2                # limitation
  682.     expr1 @ expr2                # transmission
  683.     expr1 ! expr2                # invocation
  684.  
  685.     expr1 ^ expr2                # power
  686.  
  687.     expr1 * expr2                # product
  688.     expr1 / expr2                # quotient
  689.     expr1 % expr2                # remainder
  690.     expr1 ** expr2                # intersection
  691.  
  692.     expr1 + expr2                # sum
  693.     expr1 - expr2                # numeric difference
  694.  
  695.     expr1 ++ expr2                # union
  696.     expr1 -- expr2                # cset or set difference
  697.  
  698.     expr1 || expr2                # string concatenation
  699.     expr1 ||| expr2             # list concatenation
  700.  
  701.     expr1 < expr2                # numeric comparison
  702.     expr1 <= expr2                # "
  703.     expr1 = expr2                # "
  704.     expr1 >= expr2                # "
  705.     expr1 > expr2                # "
  706.     expr1 ~= expr2                # "
  707.     expr1 << expr2                # string comparison
  708.     expr1 <<= expr2             # "
  709.     expr1 == expr2                # "
  710.     expr1 >>= expr2             # "
  711.     expr1 >> expr2                # "
  712.     expr1 ~== expr2             # "
  713.     expr1 === expr2             # value comparison
  714.     expr1 ~=== expr2            # "
  715.  
  716.     expr1 | expr2                # alternation
  717.  
  718.     expr1 to expr2 by expr3     # integer generation
  719.  
  720.     expr1 := expr2                # assignment
  721.     expr1 <- expr2                # reversible assignment
  722.     expr1 :=: expr2             # exchange
  723.     expr1 <-> expr2             # reversible exchange
  724.     expr1 op:= expr2            # (augmented assignments)
  725.  
  726.     expr1 ? expr2                # string scanning
  727.  
  728.     expr1 & expr2                # conjunction
  729.  
  730. Low Precedence Expressions
  731.  
  732.     break [expr]                    # break from loop
  733.     case expr0 of {                 # case selection
  734.        expr1:expr2
  735.        ...
  736.        [default:exprn]
  737.        }
  738.     create expr                     # co-expression creation
  739.     every expr1 [do expr2]            # iterate over generated values
  740.     fail                            # failure of procedure
  741.     if expr1 then exp2 [else exp3]    # if-then-else
  742.     next                            # go to top of loop
  743.     repeat expr                     # loop
  744.     return expr                     # return from procedure
  745.     suspend expr1 [do expr2]        # suspension of procedure
  746.     until expr1 [do expr2]            # until-loop
  747.     while expr1 [do expr2]            # while-loop
  748. -
  749. Functions and datatypes of arguments and produced values:
  750.  
  751. abs(N) : N                                # compute absolute value
  752. acos(r1) : r2                            # compute arc cosine
  753. any(c,s,i1,i2) : i3                     # locate initial character
  754. args(p) : i                             # get number of procedure arguments
  755. bal(c1,c2,c3,s,i1,i2) : i3,i4,...,in    # locate balanced characters
  756. callout(x,x1,x2,...,xn) : xm            # call external function
  757. center(s1,i,s2) : s3                    # position string at center
  758. char(i) : s                             # produce character
  759. chdir(s) : n                            # change directory
  760. close(f) : f                            # close file
  761. collect(i1,i2) : n                        # perform garbage collection
  762. copy(x1) : x2                            # copy value
  763. cos(r1) : r2                            # compute cosine
  764. cset(x)                                 # convert to cset
  765. delay(i) : n                            # delay execution
  766. delete(X,x) : X                         # delete element
  767. detab(s1,i1,i2,...,in) : s2             # remove tabs
  768. display(i,f) : n                        # display variables
  769. dtor(r1) : r2                            # convert degrees to radians
  770. entab(s1,i1,i2,...,in) : s2             # insert tabs
  771. errorclear() : n                        # clear error indication
  772. exit(i)                                 # exit program
  773. exp(r1) : r2                            # compute exponential
  774. find(s1,s2,i1,i2) : i3,i4,...,in        # find string
  775. flush(f) : n                            # flush I/O buffer
  776. function() : s1,s2,...,sn                # generate function names
  777. get(L) : x                                # get value from list
  778. getenv(s1) : s2                         # get value of environment variable
  779. iand(i1,i2) : i3                        # compute bit-wise "and"
  780. icom(i1) : i2                            # compute bit-wise complement
  781. image(x) : s                            # produce string image
  782. insert(X,x1,x2) : X                     # insert element
  783. integer(x) : i                            # convert to integer
  784. ior(i1,i2) : i3                         # compute bit-wise inclusive "or"
  785. ishift(i1,i2) : i3                        # shift bits
  786. ixor(i1,i2) : i3                        # compute bit-wise exclusive "or"
  787. key(T) : x1,x2,...,xn                    # generate keys from table
  788. left(s1,i,s2) : s3                        # position string at left
  789. list(i,x) : L                            # create list
  790. log(r1,r2) : r3                         # compute logarithm
  791. many(c,s,i1,i2) : i3                    # locate many characters
  792. map(s1,s2,s3) : s4                        # map characters
  793. match(s1,s2,i1,i2) : i3                 # match initial string
  794. member(X,x) : x                         # test for membership
  795. move(i) : s                             # move scanning position
  796. name(x) : s                             # produce name
  797. numeric(x) : N                            # convert to numeric
  798. open(s1,s2) : f                         # open file
  799. ord(s) : i                                # produce ordinal
  800. pop(L) : x                                # pop from list
  801. pos(i1) : i2                            # test scanning position
  802. proc(x,i) : p                            # convert to procedure
  803. pull(L) : x                             # pull from list
  804. push(L,x) : L                            # push onto list
  805. put(L,x) : L                            # put onto list
  806. read(f) : s                             # read line
  807. reads(f,i) : s                            # read string
  808. real(x) : r                             # convert to real
  809. remove(s) : n                            # remove file
  810. rename(s1,s2) : n                        # rename file
  811. repl(s1,i) : s2                         # replicate string
  812. reverse(s1) : s2                        # reverse string
  813. right(s1,i,s2) : s3                     # position string at right
  814. rtod(r1) : r2                            # convert radians to degrees
  815. runerr(i,x)                             # terminate with run-time error
  816. save(s) : i                             # save executable image
  817. seek(f,i) : f                            # seek to position in file
  818. seq(i1,i2) : i3,i4,...                    # generate sequence of integers
  819. set(L) : S                                # create set
  820. sin(r1) : r2                            # compute sine
  821. sort(X,i) : L                            # sort structure
  822. sortf(X,i) : L                            # sort list or set by field
  823. sqrt(r1) : r2                            # compute square root
  824. stop(x1,x2,...,xn)                        # stop execution
  825. string(x) : s                            # convert to string
  826. system(s) : i                            # call system function
  827. tab(i) : s                                # set scanning position
  828. table(x) : T                            # create table
  829. tan(r1) : r2                            # compute tangent
  830. trim(s1,c) : s2                         # trim string
  831. type(x) : s                             # produce type name
  832. upto(c,s,i1,i2) : i3,i4,...,in            # locate characters
  833. variable(s) : x                         # produce variable
  834. where(f) : i                            # produce position in file
  835. write(x1,x2,...,xn) : xn                # write line
  836. writes(x1,x2,...,xn)                    # write string
  837. -
  838. Operations and required datatypes
  839.  
  840. prefix operations
  841.  
  842.     +N : N                        # compute positive
  843.     -N : N                        # compute negative
  844.     ~c1 : c2                    # compute cset complement
  845.     =s1 : s2                    # match string in scanning
  846.     @C : x                        # activate co-expression
  847.     ^C1 : C2                    # create refreshed co-expression
  848.     *x : i                        # compute size
  849.     ?x1 : x2                    # generate random value
  850.     !x : x1,x2,...,xn            # generate values
  851.     /x : x                        # check for null value
  852.     \x : x                        # check for non-null value
  853.     .x : x                        # dereference variable
  854.  
  855. infix operations
  856.  
  857.     N1 + N2 : N3                # compute sum
  858.     N1 - N2 : N3                # compute difference
  859.     N1 * N2 : N3                # compute product
  860.     N1 / N2 : N3                # compute quotient
  861.     N1 % N2 : N3                # compute remainder
  862.     N1 ^ N2 : N3                # compute exponential
  863.     x1 ++ x2 : x3                # compute cset or set union
  864.     x1 -- x2 : x3                # compute cset or set difference
  865.     x1 ** x2 : x3                # compute cset or set intersection
  866.     s1 || s2 : s3                # concatenate strings
  867.     L1 ||| L2 : L3                # concatenate lists
  868.     R.F : x                     # get field of record
  869.     x1 @ C : x2                 # transmission value to co-expression
  870.     x1 & x2 : x2                # evaluate in conjunction
  871.     N1 < N2 : N2                # compare numerically
  872.     N1 <= N2 : N2                # "
  873.     N1 = N2 : N2                # "
  874.     N1 >= N2 : N2                # "
  875.     N1 > N2 : N2                # "
  876.     N1 ~= N2 : N2                # "
  877.     s1 << s2 : s2                # compare lexically
  878.     s1 <<= s2 : s2                # "
  879.     s1 == s2 : s2                # "
  880.     s1 >>= s2 : s2                # "
  881.     s1 >> s2 : s2                # "
  882.     s1 ~== s2 : s2                # "
  883.     x1 === x2 : x2                # compare values
  884.     x1 ~=== x2 : x2             # "
  885.     x1 := x2 : x1                # assign value
  886.     x1 op:= x2 : x1             # augmented assignment
  887.     x1 :=: x2 : x1                # exchange values
  888.     x1 <- x2 : x1                # assign value reversibly
  889.     x1 <-> x2 : x1                # exchange values reversibly
  890. -
  891. Keywords
  892.  
  893.     &allocated : i1,i2,i3,i4    # accumulated bytes allocated
  894.                                 # (total,static,string,block)
  895.     &ascii : c                    # cset of ascii characters
  896.     &clock : s                    # current time of day
  897.     &collections : i1,i2,i3,i4    # collection count
  898.                                 # (total,static,string,block)
  899.     &cset : c                    # cset of all characters
  900.     ¤t : C                # current co-expression
  901.     &date : s                    # current date
  902.     &dateline : s                # current date and time
  903.     &digits : c                 # cset of digits 0-9
  904.     &e : r                        # base of natural logarithms, 2.71828...
  905.     &error : i                    # run-time error conversion control
  906.     &errornumber : i            # run-time error number
  907.     &errortext : s                # run-time error message text
  908.     &errorvalue : x             # run-time error offending value
  909.     &errout : f                 # standard error output file
  910.     &fail                        # fails
  911.     &features : s1,s2,...,sn    # implementation features
  912.     &file : s                    # current source code file name
  913.     &host : s                    # string identifying host computer
  914.     &input : f                    # standard input file
  915.     &lcase : c                    # cset of lower case letters a-z
  916.     &letters : c                # cset of all letters A-Za-z
  917.     &level : i                    # level of current procedure call
  918.     &line : i                    # current source code line number
  919.     &main : C                    # main co-expression
  920.     &null : n                    # the null value
  921.     &output : f                 # standard output file
  922.     &phi : r                    # The golden ratio, 1.61803...
  923.     &pi : r                     # The value of pi, 3.14159...
  924.     &pos : i                    # string scanning position
  925.     &random : i                 # random number seed
  926.     ®ions : i1,i2,i3         # current region size
  927.                                 # (static,string,block)
  928.     &source : C                 # activator of current co-expression
  929.     &storage : i1,i2,i3         # current bytes allocated
  930.                                 # (static,string,block)
  931.     &subject : s                # string scanning subject
  932.     &time : i                    # current run time in milliseconds
  933.     &trace : i                    # procedure tracing control
  934.     &ucase : c                    # cset of upper case letters A-Z
  935.     &version : s                # version of Icon
  936. -
  937. Datatypes
  938.  
  939.     null(n)     string(s)  co-expression(C)  table(T)
  940.     integer(i)    cset(c)    procedure(p)      set(S)
  941.     real(r)     file(f)    list(L)             <record types>(R)
  942.  
  943.     (see also "Abbreviations")
  944. -
  945. Reserved words
  946.  
  947.     break        do            global        next        repeat        to
  948.     by            else        if            not         return        until
  949.     case        end         initial     of            static        while
  950.     create        every        link        procedure    suspend
  951.     default     fail        local        record        then
  952. -
  953. Escapes in string and cset constants
  954.  
  955.     \b        backspace                    \v        vertical tab
  956.     \d        delete(rubout)                \'        single quote
  957.     \e        escape (altmode)            \"        double quote
  958.     \f        formfeed                    \\        backslash
  959.     \l        linefeed (newline)            \ddd    octal code
  960.     \n        newline (linefeed)            \xdd    hexadecimal code
  961.     \r        carriage return             \^c     control code
  962.     \t        horizontal tab
  963. -
  964. Abbreviations used in Icon help files (and other Icon literature)
  965.  
  966.         c        cset            C        co-expression
  967.         f        file            L        list
  968.         i        integer         N        numeric (i or r)
  969.         n        null            R        record (any record type)
  970.         p        procedure        S        set
  971.         r        real            T        table
  972.         s        string            X        any structure type (L, R, S, or T)
  973.         x        any type        F        field of record
  974. -
  975. About the Icon Programming Language Help File
  976.  
  977. Information used in this help file was obtained from the following
  978. sources:
  979.  
  980. Griswold, Ralph E. and Madge T. Griswold.  "The Icon Programming
  981. Language, Second Edition", Prentice-Hall, Inc., Englewood Cliffs, New
  982. Jersey.  1990.
  983.  
  984. Griswold, Ralph E.    ICONT(1), manual page for "UNIX Programmer's
  985. Manual", Department of Computer Science, The University of Arizona.
  986. 1988.
  987.  
  988. Griswold, Ralph  E., Clinton L. Jeffery, Gregg M. Townsend, and
  989. Kenneth Walker.  "Version 8.6 of the Icon Programming Language",
  990. IPD188, Department of Computer Science, The University of Arizona.
  991. 1992.
  992.  
  993. Further information on the Icon Programming Language can be obtained
  994. from:
  995.  
  996.         Icon Project
  997.         Department of Computer Science
  998.         Gould-Simpson Building
  999.         The University of Arizona
  1000.         Tucson, Arizona  85721
  1001.         U.S.A.
  1002.         (602) 621-2018
  1003.         icon-project@cs.arizona.edu                     (Internet)
  1004.         ...{uunet,allegra,noao}!arizona!icon-project    (uucpnet)
  1005.  
  1006. April 2, 1992.
  1007.